package hg.framework.validators.validator;

import hg.framework.utils.HgStringUtils;
import hg.framework.validators.annotation.HgPhone;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * 验证器
 * @author hgSuper
 * @date 2020-06-24
 */
public class HgPhoneValidator implements ConstraintValidator<HgPhone, String> {

    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        return HgStringUtils.isPhone(s);
    }
}
